﻿using System;

namespace WebPages
{
    public partial class _Default : System.Web.UI.Page
    {
        void UpdateSessionStateMessage()
        {
            // Demonstrate that the table store session-state provider works
            if (String.IsNullOrEmpty(Session["Started"] as string))
                Session["Started"] = String.Format(@"Your current session has id ""{0}"" and was started {1}.", Session.SessionID , DateTime.Now);

            SessionStateMessage.Text = Session["Started"] as string;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                UpdateSessionStateMessage();
            }
            catch (Exception)
            {
                // Intentionally blank section.
            }
        }
    }
}
